
<%@page import="storeMovie.JavaBean.Movie"%>
<%@page import="java.util.List"%>
<%@page import="storeMovie.Util.MovieManager"%>
<%@page import="javax.swing.text.html.HTMLEditorKit.Parser"%><?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="java.sql.*"%>
<%
	String categoryID = request.getParameter("categoryID");
	int id = Integer.parseInt(categoryID);
	MovieManager manager = new MovieManager();
	List<Movie> listMovies = manager.getMovieByCategory(id);
	if (listMovies.size() == 0) {
		out.println("This category don't has any product");
	} else {
		for (int i = 0; i < listMovies.size(); i++) {
			Movie movie = listMovies.get(i);
			if (i % 2 == 0) {
				out.println("<div class='leftbox' id='leftbox"
						+ movie.getMovieId() + "'>");
			} else {
				out.println("<div class='rightbox' id='rightbox"
						+ movie.getMovieId() + "'>");
			}
			out.println("<h3>" + movie.getMovieName() + "</h3>");
			out.println("<a href='#' onclick='showDetail("
					+ movie.getMovieId() + ")' rel='lightbox' title='"
					+ movie.getMovieName() + "'>");
			out
					.println("<img src='"
							+ movie.getMovieImage()
							+ "' width='93' height='95' alt='photo 1' class='left' />");
			out.println("</a>");
			out
					.println("<p><b>Price:</b> <b>$"
							+ movie.getMoviePrice()
							+ "</b> &amp; eligible for FREE Super Saver Shipping on orders over <b></b>.</p>");
			out
					.println("<p><b>Availability:</b> Usually ships within 24 hours</p>");
			out.println("<p class='readmore'><a id='id"
					+ movie.getMovieId()
					+ "' href='#' onclick='fc6(this.id,"
					+ movie.getMovieId() + ")'>BUY <b>NOW</b></a></p>");
			out.println("<div class='clear'></div>");
			out.println("</div>");
			if ((i % 2 == 1) && (i != listMovies.size() - 1)) {
				out.println("<div class='clear br'></div>");
			}
		}
	}
%>
